package com.szp.controller;

import com.szp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/login")
    public String login(String uname, String upass, Model model){
        boolean login = userService.login(uname, upass);
        if(login){
            model.addAttribute("uname",uname);
            return "success";
        }else {
            return "fail";
        }
    }
}
//xiaomaolaodi
